package controllers;

import models.PlayTable;

public class PlayerAutoAction extends Thread {
	private int actionId;
	private Object[] addParameter;
	private PlayTable table;
	private long playerId;
	private int delayMillis;
	
	public PlayerAutoAction(PlayTable table, long playerId, int actionId, Object[] addParameters, int delayMillis) {
		this.table = table;
		this.playerId = playerId;
		this.actionId = actionId;
		this.delayMillis = delayMillis;
		this.addParameter = addParameters;
	}
	
	@Override
	public void run() {
		try {
			sleep(delayMillis);
		} catch(InterruptedException e) {
			return;
		}
		table.performAction(actionId, playerId, addParameter);
	}
}
